import request from '@/utils/request'
import fileRequest from '@/utils/file'





export function selectMilitarySportsByIdApi(params) {
  //此处直接使用参数
  return request({
    url: '/sports/selectMilitarySportsById',
    method: 'GET',
    params
  })
}
export function getMilitarySportsListApi(params) {
  //此处直接使用参数
  return request({
    url: '/sports/getMilitarySportsList',
    method: 'GET',
    params
  })
}

export function deleteMilitarySportsApi(params){
  return request({
    url:'/sports/deleteMilitarySports',
    method:'GET',
    params
  })
}
export function insertMilitarySportsApi(data) {
  return request({
    url: '/sports/insertMilitarySports',
    method: 'POST',
    data: data
  })
}

/**
 * 军事体育导出
 * @param data
 * @returns {*}
 */
export function exportRoster(data) {
  return fileRequest({
    url: '/excel/militarySportsExcel',
    method: 'POST',
    data: data,
    responseType:'blob'
  })
}

export function exportRoster1(data) {
  return fileRequest({
    url: '/excel/militarySportsNewExcel',
    method: 'POST',
    data: data,
    responseType:'blob'
  })
}

/**
 * 文件导入
 * @param data
 */
export function importSportsApi(data) {
  return request({
    url: '/import/importSports',
    method: 'POST',
    data
  })
}

export function importSports1Api(data) {
  return request({
    url: '/import/importNewSports',
    method: 'POST',
    data
  })
}

export function exportExcelApi(data) {
  return fileRequest({
    url: '/excel/exportExcel',
    method: 'POST',
    data
  })
}


export function deleteMilitarySportsByIds(params) {
  return request({
    url: '/newSports/deleteMilitarySportsByIds',
    method: 'DELETE',
    params,
  });
}


export function selectNewMilitarySportsByIdApi(params) {
  //此处直接使用参数
  return request({
    url: '/newSports/selectMilitarySportsById',
    method: 'GET',
    params
  })
}
export function getNewMilitarySportsListApi(params) {
  //此处直接使用参数
  return request({
    url: '/newSports/getMilitarySportsList',
    method: 'GET',
    params
  })
}

export function deleteNewMilitarySportsApi(params){
  return request({
    url:'/newSports/deleteMilitarySports',
    method:'GET',
    params
  })
}
export function insertNewMilitarySportsApi(data) {
  return request({
    url: '/newSports/insertMilitarySports',
    method: 'POST',
    data: data
  })
}
